IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spILPData_Create')
	BEGIN
		PRINT 'Dropping Procedure spILPData_Create'
		DROP  Procedure  spILPData_Create
	END

GO

PRINT 'Creating Procedure spILPData_Create'
GO
CREATE Procedure dbo.spILPData_Create
	( 	  
	  @ID int, 
		@BondAmt money = null, 
		@OutBal money = null, 
		@AmtPastDue money = null, 
		@ValAmt money = null, 
		@PrePaid money = null, 
		@Monthly money = null, 
		@BondRegDate DateTime = null, 
		@ValDate DateTime = null, 
		@Status char(3) = null, 
		@SubStatus char(3) = null, 
		@BranchCode char(3) = null, 
		@custID varchar(25) = null, 
		@custName1 varchar(100) = null, 
		@custName2 varchar(100) = null, 
		@custPersTel varchar(20) = null, 
		@custBussTel varchar(20) = null, 
		@custContTel varchar(20) = null, 
		@AccountDate DateTime = null, 
		@Suburb varchar(50) = null, 
		@Stand varchar(50) = null, 
		@Complex varchar(50) = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 8/22/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO ILPData
	  (
		ID,
			BondAmt,
			OutBal,
			AmtPastDue,
			ValAmt,
			PrePaid,
			Monthly,
			BondRegDate,
			ValDate,
			Status,
			SubStatus,
			BranchCode,
			custID,
			custName1,
			custName2,
			custPersTel,
			custBussTel,
			custContTel,
			AccountDate,
			Suburb,
			Stand,
			Complex	  
	  )
	VALUES
	  (
		@ID,
			@BondAmt,
			@OutBal,
			@AmtPastDue,
			@ValAmt,
			@PrePaid,
			@Monthly,
			@BondRegDate,
			@ValDate,
			@Status,
			@SubStatus,
			@BranchCode,
			@custID,
			@custName1,
			@custName2,
			@custPersTel,
			@custBussTel,
			@custContTel,
			@AccountDate,
			@Suburb,
			@Stand,
			@Complex
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spILPData_Create: Unable to Insert a new ILPData', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'ILPData_ID'

	-- Return to calling method
	RETURN 

GO
